<!doctype html>
<meta charset="utf8">

<emu-clause id="sec-temporal-duration-objects">
  <h1>Temporal.Duration Objects</h1>

  <p>
    A Temporal.Duration object describes the difference in elapsed time between
    two other Temporal objects of the same type: Instant, PlainDate,
    PlainDateTime, PlainTime, PlainYearMonth, or ZonedDateTime. Objects of this
    type are only created via the <i>.since()</i> and <i>.until()</i> methods of
    these objects.
  </p>

  <emu-clause id="sec-temporal-duration-constructor">
    <h1>The Temporal.Duration Constructor</h1>
    <p>The Temporal.Duration constructor:</p>
    <ul>
      <li>
        creates and initializes a new Temporal.Duration object when called as a constructor.
      </li>
      <li>
        is not intended to be called as a function and will throw an exception when called in that manner.
      </li>
      <li>
        may be used as the value of an `extends` clause of a class definition.
        Subclass constructors that intend to inherit the specified Temporal.Duration behaviour must
        include a super call to the %Temporal.Duration% constructor to create and initialize subclass
        instances with the necessary internal slots.
      </li>
    </ul>

    <emu-clause id="sec-temporal.duration">
      <h1>Temporal.Duration ( [ _years_ [ , _months_ [ , _weeks_ [ , _days_ [ , _hours_ [ , _minutes_ [ , _seconds_ [ , _milliseconds_ [ , _microseconds_ [ , _nanoseconds_ ] ] ] ] ] ] ] ] ] ] )</h1>
      <p>
        When the `Temporal.Duration` function is called, the following steps are taken:
      </p>
      <emu-note>The value of ? ToIntegerOrInfinity(*undefined*) is 0.</emu-note>
      <emu-alg>
        1. If NewTarget is *undefined*, then
          1. Throw a *TypeError* exception.
        1. Let _y_ be ? ToIntegerOrInfinity(_years_).
        1. Let _mo_ be ? ToIntegerOrInfinity(_months_).
        1. Let _w_ be ? ToIntegerOrInfinity(_weeks_).
        1. Let _d_ be ? ToIntegerOrInfinity(_days_).
        1. Let _h_ be ? ToIntegerOrInfinity(_hours_).
        1. Let _m_ be ? ToIntegerOrInfinity(_minutes_).
        1. Let _s_ be ? ToIntegerOrInfinity(_seconds_).
        1. Let _ms_ be ? ToIntegerOrInfinity(_milliseconds_).
        1. Let _mis_ be ? ToIntegerOrInfinity(_microseconds_).
        1. Let _ns_ be ? ToIntegerOrInfinity(_nanoseconds_).
        1. Return ? CreateTemporalDuration(_y_, _mo_, _w_, _d_, _h_, _m_, _s_, _ms_, _mis_, _ns_, NewTarget).
      </emu-alg>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-properties-of-the-temporal-duration-constructor">
    <h1>Properties of the Temporal.Duration Constructor</h1>
    <p>
      The value of the [[Prototype]] internal slot of the Temporal.Duration
      constructor is the intrinsic object %Function.prototype%.
    </p>
    <p>The Temporal.Duration constructor has the following properties:</p>

    <emu-clause id="sec-temporal-duration-prototype">
      <h1>Temporal.Duration.prototype</h1>
      <p>
        The initial value of `Temporal.Duration.prototype` is
        %Temporal.Duration.prototype%.
      </p>
      <p>
        This property has the attributes { [[Writable]]: *false*, [[Enumerable]]:
        *false*, [[Configurable]]: *false* }.
      </p>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.from">
      <h1>Temporal.Duration.from ( _item_ )</h1>
      <p>
        The `from` method takes one argument _item_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. If Type(_item_) is Object and _item_ has an [[InitializedTemporalDuration]] internal slot, then
          1. Return ? CreateTemporalDuration(_item_.[[Years]], _item_.[[Months]], _item_.[[Weeks]], _item_.[[Days]], _item_.[[Hours]], _item_.[[Minutes]], _item_.[[Seconds]], _item_.[[Milliseconds]], _item_.[[Microseconds]], _item_.[[Nanoseconds]]).
        1. Return ? ToTemporalDuration(_item_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.compare">
      <h1>Temporal.Duration.compare ( _one_, _two_ [ , _options_ ] )</h1>
      <p>
        The `compare` method takes three arguments, _one_, _two_, and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Set _one_ to ? ToTemporalDuration(_one_).
        1. Set _two_ to ? ToTemporalDuration(_two_).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _relativeTo_ be ? ToRelativeTemporalObject(_options_).
        1. Let _shift1_ be ! CalculateOffsetShift(_relativeTo_, _one_.[[Years]], _one_.[[Months]], _one_.[[Weeks]], _one_.[[Days]], _one_.[[Hours]], _one_.[[Minutes]], _one_.[[Seconds]], _one_.[[Milliseconds]], _one_.[[Microseconds]], _one_.[[Nanoseconds]]).
        1. Let _shift2_ be ! CalculateOffsetShift(_relativeTo_, _two_.[[Years]], _two_.[[Months]], _two_.[[Weeks]], _two_.[[Days]], _two_.[[Hours]], _two_.[[Minutes]], _two_.[[Seconds]], _two_.[[Milliseconds]], _two_.[[Microseconds]], _two_.[[Nanoseconds]]).
        1. If any of _one_.[[Years]], _two_.[[Years]], _one_.[[Months]], _two_.[[Months]], _one_.[[Weeks]], or _two_.[[Weeks]] are not 0, then
          1. Let _balanceResult1_ be ? UnbalanceDurationRelative(_one_.[[Years]], _one_.[[Months]], _one_.[[Weeks]], _one_.[[Days]], *"day"*, _relativeTo_).
          1. Let _balanceResult2_ be ? UnbalanceDurationRelative(_two_.[[Years]], _two_.[[Months]], _two_.[[Weeks]], _two_.[[Days]], *"day"*, _relativeTo_).
          1. Let _days1_ be _balanceResult1_.[[Days]].
          1. Let _days2_ be _balanceResult2_.[[Days]].
        1. Else,
          1. Let _days1_ be _one_.[[Days]].
          1. Let _days2_ be _two_.[[Days]].
        1. Let _ns1_ be ! TotalDurationNanoseconds(_days1_, _one_.[[Hours]], _one_.[[Minutes]], _one_.[[Seconds]], _one_.[[Milliseconds]], _one_.[[Microseconds]], _one_.[[Nanoseconds]], _shift1_).
        1. Let _ns2_ be ! TotalDurationNanoseconds(_days2_, _two_.[[Hours]], _two_.[[Minutes]], _two_.[[Seconds]], _two_.[[Milliseconds]], _two_.[[Microseconds]], _two_.[[Nanoseconds]], _shift2_).
        1. If _ns1_ &gt; _ns2_, return 1.
        1. If _ns1_ &lt; _ns2_, return −1.
        1. Return 0.
      </emu-alg>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-properties-of-the-temporal-duration-prototype-object">
    <h1>Properties of the Temporal.Duration Prototype Object</h1>

    <p>The Temporal.Duration prototype object</p>
    <ul>
      <li>is itself an ordinary object.</li>
      <li>is not a Temporal.Duration instance and doesn't have an [[InitializedTemporalDuration]] internal slot.</li>
      <li>has a [[Prototype]] internal slot whose value is %Object.prototype%.</li>
    </ul>

    <emu-clause id="sec-temporal.duration.prototype.constructor">
      <h1>Temporal.Duration.prototype.constructor</h1>
      <p>The initial value of `Temporal.Duration.prototype.constructor` is %Temporal.Duration%.</p>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype-@@tostringtag">
      <h1>Temporal.Duration.prototype[ @@toStringTag ]</h1>
      <p>The initial value of the @@toStringTag property is the string value *"Temporal.Duration"*.</p>
      <p>This property has the attributes { [[Writable]]: *false*, [[Enumerable]]: *false*, [[Configurable]]: *true* }.</p>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.years">
      <h1>get Temporal.Duration.prototype.years</h1>
      <p>
        `Temporal.Duration.prototype.years` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Years]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.months">
      <h1>get Temporal.Duration.prototype.months</h1>
      <p>
        `Temporal.Duration.prototype.months` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Months]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.weeks">
      <h1>get Temporal.Duration.prototype.weeks</h1>
      <p>
        `Temporal.Duration.prototype.weeks` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Weeks]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.days">
      <h1>get Temporal.Duration.prototype.days</h1>
      <p>
        `Temporal.Duration.prototype.days` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Days]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.hours">
      <h1>get Temporal.Duration.prototype.hours</h1>
      <p>
        `Temporal.Duration.prototype.hours` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Hours]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.minutes">
      <h1>get Temporal.Duration.prototype.minutes</h1>
      <p>
        `Temporal.Duration.prototype.minutes` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Minutes]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.seconds">
      <h1>get Temporal.Duration.prototype.seconds</h1>
      <p>
        `Temporal.Duration.prototype.seconds` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Seconds]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.milliseconds">
      <h1>get Temporal.Duration.prototype.milliseconds</h1>
      <p>
        `Temporal.Duration.prototype.milliseconds` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Milliseconds]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.microseconds">
      <h1>get Temporal.Duration.prototype.microseconds</h1>
      <p>
        `Temporal.Duration.prototype.microseconds` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Microseconds]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.nanoseconds">
      <h1>get Temporal.Duration.prototype.nanoseconds</h1>
      <p>
        `Temporal.Duration.prototype.nanoseconds` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return _duration_.[[Nanoseconds]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.sign">
      <h1>get Temporal.Duration.prototype.sign</h1>
      <p>
        `Temporal.Duration.prototype.sign` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return ! DurationSign(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-get-temporal.duration.prototype.blank">
      <h1>get Temporal.Duration.prototype.blank</h1>
      <p>
        `Temporal.Duration.prototype.blank` is an accessor property whose set accessor function is *undefined*.
        Its get accessor function performs the following steps:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Let _sign_ be ! DurationSign(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]]).
        1. If _sign_ = 0, return *true*.
        1. Return *false*.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.with">
      <h1>Temporal.Duration.prototype.with ( _temporalDurationLike_ )</h1>
      <p>
        The `with` method takes one argument _temporalDurationLike_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Let _temporalDurationLike_ be ? ToPartialDuration(_temporalDurationLike_).
        1. If _temporalDurationLike_.[[Years]] is not *undefined*, then
          1. Let _years_ be _temporalDurationLike_.[[Years]].
        1. Else,
          1. Let _years_ be _duration_.[[Years]].
        1. If _temporalDurationLike_.[[Months]] is not *undefined*, then
          1. Let _months_ be _temporalDurationLike_.[[Months]].
        1. Else,
          1. Let _months_ be _duration_.[[Months]].
        1. If _temporalDurationLike_.[[Weeks]] is not *undefined*, then
          1. Let _weeks_ be _temporalDurationLike_.[[Weeks]].
        1. Else,
          1. Let _weeks_ be _duration_.[[Weeks]].
        1. If _temporalDurationLike_.[[Days]] is not *undefined*, then
          1. Let _days_ be _temporalDurationLike_.[[Days]].
        1. Else,
          1. Let _days_ be _duration_.[[Days]].
        1. If _temporalDurationLike_.[[Hours]] is not *undefined*, then
          1. Let _hours_ be _temporalDurationLike_.[[Hours]].
        1. Else,
          1. Let _hours_ be _duration_.[[Hours]].
        1. If _temporalDurationLike_.[[Minutes]] is not *undefined*, then
          1. Let _minutes_ be _temporalDurationLike_.[[Minutes]].
        1. Else,
          1. Let _minutes_ be _duration_.[[Minutes]].
        1. If _temporalDurationLike_.[[Seconds]] is not *undefined*, then
          1. Let _seconds_ be _temporalDurationLike_.[[Seconds]].
        1. Else,
          1. Let _seconds_ be _duration_.[[Seconds]].
        1. If _temporalDurationLike_.[[Milliseconds]] is not *undefined*, then
          1. Let _milliseconds_ be _temporalDurationLike_.[[Milliseconds]].
        1. Else,
          1. Let _milliseconds_ be _duration_.[[Milliseconds]].
        1. If _temporalDurationLike_.[[Microseconds]] is not *undefined*, then
          1. Let _microseconds_ be _temporalDurationLike_.[[Microseconds]].
        1. Else,
          1. Let _microseconds_ be _duration_.[[Microseconds]].
        1. If _temporalDurationLike_.[[Nanoseconds]] is not *undefined*, then
          1. Let _nanoseconds_ be _temporalDurationLike_.[[Nanoseconds]].
        1. Else,
          1. Let _nanoseconds_ be _duration_.[[Nanoseconds]].
        1. Return ? CreateTemporalDuration(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.negated">
      <h1>Temporal.Duration.prototype.negated ( )</h1>
      <p>
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return ! CreateTemporalDuration(−_duration_.[[Years]], −_duration_.[[Months]], −_duration_.[[Weeks]], −_duration_.[[Days]], −_duration_.[[Hours]], −_duration_.[[Minutes]], −_duration_.[[Seconds]], −_duration_.[[Milliseconds]], −_duration_.[[Microseconds]], −_duration_.[[Nanoseconds]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.abs">
      <h1>Temporal.Duration.prototype.abs ( )</h1>
      <p>
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return ! CreateTemporalDuration(abs(_duration_.[[Years]]), abs(_duration_.[[Months]]), abs(_duration_.[[Weeks]]), abs(_duration_.[[Days]]), abs(_duration_.[[Hours]]), abs(_duration_.[[Minutes]]), abs(_duration_.[[Seconds]]), abs(_duration_.[[Milliseconds]]), abs(_duration_.[[Microseconds]]), abs(_duration_.[[Nanoseconds]])).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.add">
      <h1>Temporal.Duration.prototype.add ( _other_ [ , _options_ ] )</h1>
      <p>
        The `add` method takes two arguments, _other_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Set _other_ to ? ToLimitedTemporalDuration(_other_, « »).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _relativeTo_ be ? ToRelativeTemporalObject(_options_).
        1. Let _result_ be ? AddDuration(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], _other_.[[Years]], _other_.[[Months]], _other_.[[Weeks]], _other_.[[Days]], _other_.[[Hours]], _other_.[[Minutes]], _other_.[[Seconds]], _other_.[[Milliseconds]], _other_.[[Microseconds]], _other_.[[Nanoseconds]], _relativeTo_).
        1. Return ? CreateTemporalDuration(_result_.[[Years]], _result_.[[Months]], _result_.[[Weeks]], _result_.[[Days]], _result_.[[Hours]], _result_.[[Minutes]], _result_.[[Seconds]], _result_.[[Milliseconds]], _result_.[[Microseconds]], _result_.[[Nanoseconds]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.subtract">
      <h1>Temporal.Duration.prototype.subtract ( _other_ [ , _options_ ] )</h1>
      <p>
        The `subtract` method takes two arguments, _other_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Set _other_ to ? ToLimitedTemporalDuration(_other_, « »).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _relativeTo_ be ? ToRelativeTemporalObject(_options_).
        1. Let _result_ be ? AddDuration(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], −_other_.[[Years]], −_other_.[[Months]], −_other_.[[Weeks]], −_other_.[[Days]], −_other_.[[Hours]], −_other_.[[Minutes]], −_other_.[[Seconds]], −_other_.[[Milliseconds]], −_other_.[[Microseconds]], −_other_.[[Nanoseconds]], _relativeTo_).
        1. Return ? CreateTemporalDuration(_result_.[[Years]], _result_.[[Months]], _result_.[[Weeks]], _result_.[[Days]], _result_.[[Hours]], _result_.[[Minutes]], _result_.[[Seconds]], _result_.[[Milliseconds]], _result_.[[Microseconds]], _result_.[[Nanoseconds]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.round">
      <h1>Temporal.Duration.prototype.round ( _options_ )</h1>
      <p>
        The `round` method takes one argument _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. If _options_ is *undefined*, then
          1. Throw a *TypeError* exception.
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _smallestUnitPresent_ be *true*.
        1. Let _largestUnitPresent_ be *true*.
        1. Let _smallestUnit_ be ? ToSmallestTemporalUnit(_options_, « », *undefined*).
        1. If _smallestUnit_ is *undefined*, then
          1. Set _smallestUnitPresent_ to *false*.
          1. Set _smallestUnit_ to *"nanosecond"*.
        1. Let _defaultLargestUnit_ be ! DefaultTemporalLargestUnit(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]]).
        1. Set _defaultLargestUnit_ to ! LargerOfTwoTemporalUnits(_defaultLargestUnit_, _smallestUnit_).
        1. Let _largestUnit_ be ? ToLargestTemporalUnit(_options_, « », *undefined*).
        1. If _largestUnit_ is *undefined*, then
          1. Set _largestUnitPresent_ to *false*.
          1. Set _largestUnit_ to _defaultLargestUnit_.
        1. Else if _largestUnit_ is *"auto"*, then
          1. Set _largestUnit_ to _defaultLargestUnit_.
        1. If _smallestUnitPresent_ is *false* and _largestUnitPresent_ is *false*, then
          1. Throw a *RangeError* exception.
        1. Perform ? ValidateTemporalUnitRange(_largestUnit_, _smallestUnit_).
        1. Let _roundingMode_ be ? ToTemporalRoundingMode(_options_, *"halfExpand"*).
        1. Let _maximum_ be ! MaximumTemporalDurationRoundingIncrement(_smallestUnit_).
        1. Let _roundingIncrement_ be ? ToTemporalRoundingIncrement(_options_, _maximum_, *false*).
        1. Let _relativeTo_ be ? ToRelativeTemporalObject(_options_).
        1. Let _unbalanceResult_ be ? UnbalanceDurationRelative(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _largestUnit_, _relativeTo_).
        1. Let _roundResult_ be ? RoundDuration(_unbalanceResult_.[[Years]], _unbalanceResult_.[[Months]], _unbalanceResult_.[[Weeks]], _unbalanceResult_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_[[Seconds]], _duration_[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_, _relativeTo_).
        1. Let _adjustResult_ be ? AdjustRoundedDurationDays(_roundResult_.[[Years]], _roundResult_.[[Months]], _roundResult_.[[Weeks]], _roundResult_.[[Days]], _roundResult_.[[Hours]], _roundResult_.[[Minutes]], _roundResult_.[[Seconds]], _roundResult_.[[Milliseconds]], _roundResult_.[[Microseconds]], _roundResult_.[[Nanoseconds]], _roundingIncrement_, _smallestUnit_, _roundingMode_, _relativeTo_).
        1. Let _balanceResult_ be ? BalanceDurationRelative(_adjustResult_.[[Years]], _adjustResult_.[[Months]], _adjustResult_.[[Weeks]], _adjustResult_.[[Days]], _largestUnit_, _relativeTo_).
        1. If _relativeTo_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
          1. Set _relativeTo_ to ? MoveRelativeZonedDateTime(_relativeTo_, _balanceResult_.[[Years]], _balanceResult_.[[Months]], _balanceResult_.[[Weeks]], 0).
        1. Let _result_ be ? BalanceDuration(_balanceResult_.[[Days]], _adjustResult_.[[Hours]], _adjustResult_.[[Minutes]], _adjustResult_.[[Seconds]], _adjustResult_.[[Milliseconds]], _adjustResult_.[[Microseconds]], _adjustResult_.[[Nanoseconds]], _largestUnit_, _relativeTo_).
        1. Return ? CreateTemporalDuration(_balanceResult_.[[Years]], _balanceResult_.[[Months]], _balanceResult_.[[Weeks]], _result_.[[Days]], _result_.[[Hours]], _result_.[[Minutes]], _result_.[[Seconds]], _result_.[[Milliseconds]], _result_.[[Microseconds]], _result_.[[Nanoseconds]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.total">
      <h1>Temporal.Duration.prototype.total ( _options_ )</h1>
      <p>
        The `total` method takes one argument _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _relativeTo_ be ? ToRelativeTemporalObject(_options_).
        1. Let _unit_ be ? ToTemporalDurationTotalUnit(_options_).
        1. Let _unbalanceResult_ be ? UnbalanceDurationRelative(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _unit_, _relativeTo_).
        1. Let _intermediate_ be *undefined*.
        1. If _relativeTo_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
          1. Set _intermediate_ to ? MoveRelativeZonedDateTime(_relativeTo_, _unbalanceResult_.[[Years]], _unbalanceResult_.[[Months]], _unbalanceResult_.[[Weeks]], 0).
        1. Let _balanceResult_ be ? BalanceDuration(_unbalanceResult_.[[Days]], _unbalanceResult_.[[Hours]], _unbalanceResult_.[[Minutes]], _unbalanceResult_.[[Seconds]], _unbalanceResult_.[[Milliseconds]], _unbalanceResult_.[[Microseconds]], _unbalanceResult_.[[Nanoseconds]], _unit_, _intermediate_).
        1. Let _roundResult_ be ? RoundDuration(_unbalanceResult_.[[Years]], _unbalanceResult_.[[Months]], _unbalanceResult_.[[Weeks]], _balanceResult_.[[Days]], _balanceResult_.[[Hours]], _balanceResult_.[[Minutes]], _balanceResult_.[[Seconds]], _balanceResult_.[[Milliseconds]], _balanceResult_.[[Microseconds]], _balanceResult_.[[Nanoseconds]], 1, _unit_, *"trunc"*, _relativeTo_).
        1. If _unit_ is *"year"*, then
          1. Let _whole_ be _roundResult_.[[Years]].
        1. If _unit_ is *"month"*, then
          1. Let _whole_ be _roundResult_.[[Months]].
        1. If _unit_ is *"week"*, then
          1. Let _whole_ be _roundResult_.[[Weeks]].
        1. If _unit_ is *"day"*, then
          1. Let _whole_ be _roundResult_.[[Days]].
        1. If _unit_ is *"hour"*, then
          1. Let _whole_ be _roundResult_.[[Hours]].
        1. If _unit_ is *"minute"*, then
          1. Let _whole_ be _roundResult_.[[Minutes]].
        1. If _unit_ is *"second"*, then
          1. Let _whole_ be _roundResult_.[[Seconds]].
        1. If _unit_ is *"millisecond"*, then
          1. Let _whole_ be _roundResult_.[[Milliseconds]].
        1. If _unit_ is *"microsecond"*, then
          1. Let _whole_ be _roundResult_.[[Microseconds]].
        1. Return _whole_ + _roundResult_.[[Remainder]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.tostring">
      <h1>Temporal.Duration.prototype.toString ( [ _options_ ] )</h1>
      <p>
        The `toString` method takes one argument _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Set _options_ to ? GetOptionsObject(_options_).
        1. Let _precision_ be ? ToSecondsStringPrecision(_options_).
        1. If _precision_.[[Unit]] is *"minute"*, throw a *RangeError* exception.
        1. Let _roundingMode_ be ? ToTemporalRoundingMode(_options_, *"trunc"*).
        1. Let _result_ be ? RoundDuration(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], _precision_.[[Increment]], _precision_.[[Unit]], _roundingMode_).
        1. Return ! TemporalDurationToString(_result_.[[Years]], _result_.[[Months]], _result_.[[Weeks]], _result_.[[Days]], _result_.[[Hours]], _result_.[[Minutes]], _result_.[[Seconds]], _result_.[[Milliseconds]], _result_.[[Microseconds]], _result_.[[Nanoseconds]], _precision_.[[Precision]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.tojson">
      <h1>Temporal.Duration.prototype.toJSON ( )</h1>
      <p>
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return ! TemporalDurationToString(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], *"auto"*).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.tolocalestring">
      <h1>Temporal.Duration.prototype.toLocaleString ( [ _locales_ [ , _options_ ] ] )</h1>
      <p>
        An ECMAScript implementation that includes the ECMA-402 Internationalization API must implement the `Temporal.Duration.prototype.toLocaleString` method as specified in the ECMA-402 specification. If an ECMAScript implementation does not include the ECMA-402 API the following specification of the `toLocaleString` method is used.
      </p>
      <p>
        The `toLocaleString` method takes two arguments, _locales_ and _options_.
        The following steps are taken:
      </p>
      <emu-alg>
        1. Let _duration_ be the *this* value.
        1. Perform ? RequireInternalSlot(_duration_, [[InitializedTemporalDuration]]).
        1. Return ! TemporalDurationToString(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]], *"auto"*).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal.duration.prototype.valueof">
      <h1>Temporal.Duration.prototype.valueOf ( )</h1>
      <p>
        The following steps are taken:
      </p>
      <emu-alg>
        1. Throw a *TypeError* exception.
      </emu-alg>
    </emu-clause>
  </emu-clause>

  <emu-clause id="sec-properties-of-temporal-duration-instances">
    <h1>Properties of Temporal.Duration Instances</h1>
    <p>
      Temporal.Duration instances are ordinary objects that inherit properties from the %Temporal.Duration.prototype% intrinsic object.
      Temporal.Duration instances are initially created with the internal slots described in <emu-xref href="#table-internal-slots-of-temporalduration-instances"></emu-xref>.
    </p>
    <emu-table id="table-internal-slots-of-temporalduration-instances" caption="Internal Slots of Temporal.Duration Instances">
      <table>
        <tbody>
          <tr>
            <th>
              Internal Slot
            </th>
            <th>
              Description
            </th>
          </tr>
          <tr>
            <td>
              [[InitializedTemporalDuration]]
            </td>
            <td>
              The only specified use of this slot is for distinguishing Temporal.Duration instances from other objects.
            </td>
          </tr>
          <tr>
            <td>
              [[Years]]
            </td>
            <td>
              An integer Number value representing the number of years in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Months]]
            </td>
            <td>
              An integer Number value representing the number of months in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Weeks]]
            </td>
            <td>
              An integer Number value representing the number of weeks in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Days]]
            </td>
            <td>
              An integer Number value representing the number of days in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Hours]]
            </td>
            <td>
              An integer Number value representing the number of hours in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Minutes]]
            </td>
            <td>
              An integer Number value representing the number of minutes in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Seconds]]
            </td>
            <td>
              An integer Number value representing the number of seconds in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Milliseconds]]
            </td>
            <td>
              An integer Number value representing the number of milliseconds in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Microseconds]]
            </td>
            <td>
              An integer Number value representing the number of microseconds in the duration.
            </td>
          </tr>
          <tr>
            <td>
              [[Nanoseconds]]
            </td>
            <td>
              An integer Number value representing the number of nanoseconds in the duration.
            </td>
          </tr>
        </tbody>
      </table>
    </emu-table>
  </emu-clause>

  <emu-clause id="sec-temporal-duration-abstract-ops">
    <h1>Abstract Operations</h1>

    <emu-clause id="sec-temporal-totemporalduration" aoid="ToTemporalDuration">
      <h1>ToTemporalDuration ( _item_ )</h1>
      <p>
        The abstract operation ToTemporalDuration returns its argument _item_ if it is already a Temporal.Duration instance, converts _item_ to a new Temporal.Duration instance if possible, and throws otherwise.
      </p>
      <emu-alg>
        1. If Type(_item_) is Object, then
          1. If _item_ has an [[InitializedTemporalDuration]] internal slot, then
            1. Return _item_.
          1. Let _result_ be ? ToTemporalDurationRecord(_item_).
        1. Else,
          1. Let _string_ be ? ToString(_item_).
          1. Let _result_ be ? ParseTemporalDurationString(_string_).
        1. Return ? CreateTemporalDuration(_result_.[[Years]], _result_.[[Months]], _result_.[[Weeks]], _result_.[[Days]], _result_.[[Hours]], _result_.[[Minutes]], _result_.[[Seconds]], _result_.[[Milliseconds]], _result_.[[Microseconds]], _result_.[[Nanoseconds]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-totemporaldurationrecord" aoid="ToTemporalDurationRecord">
      <h1>ToTemporalDurationRecord ( _temporalDurationLike_ )</h1>
      <emu-note>The value of ? ToIntegerOrInfinity(*undefined*) is 0.</emu-note>
      <emu-alg>
        1. Assert: Type(_temporalDurationLike_) is Object.
        1. If _temporalDurationLike_ has an [[InitializedTemporalDuration]] internal slot, then
          1. Return the Record {
              [[Years]]: _temporalDurationLike_.[[Years]],
              [[Months]]: _temporalDurationLike_.[[Months]],
              [[Weeks]]: _temporalDurationLike_.[[Weeks]],
              [[Days]]: _temporalDurationLike_.[[Days]],
              [[Hours]]: _temporalDurationLike_.[[Hours]],
              [[Minutes]]: _temporalDurationLike_.[[Minutes]],
              [[Seconds]]: _temporalDurationLike_.[[Seconds]],
              [[Milliseconds]]: _temporalDurationLike_.[[Milliseconds]],
              [[Microseconds]]: _temporalDurationLike_.[[Microseconds]],
              [[Nanoseconds]]: _temporalDurationLike_.[[Nanoseconds]]
            }.
        1. Let _result_ be a new Record with all the internal slots given in the Internal Slot column in <emu-xref href="#table-temporal-temporaldurationlike-properties"></emu-xref>.
        1. Let _any_ be *false*.
        1. For each row of <emu-xref href="#table-temporal-temporaldurationlike-properties"></emu-xref>, except the header row, in table order, do
          1. Let _prop_ be the Property value of the current row.
          1. Let _val_ be ? Get(_temporalDurationLike_, _prop_).
          1. If _val_ is not *undefined*, then
            1. Set _any_ to *true*.
          1. Let _val_ be ? ToNumber(_val_).
          1. If floor(_val_) ≠ _val_, then
            1. Throw a *RangeError* exception.
          1. Set _result_'s internal slot whose name is the Internal Slot value of the current row to _val_.
        1. If _any_ is *false*, then
          1. Throw a *TypeError* exception.
        1. Return _result_.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-durationsign" aoid="DurationSign">
      <h1>DurationSign ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ )</h1>
      <emu-alg>
        1. For each value _v_ of « _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ », do
          1. If _v_ &lt; 0, return −1.
          1. If _v_ &gt; 0, return 1.
        1. Return 0.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-isvalidduration" aoid="IsValidDuration">
      <h1>IsValidDuration ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ )</h1>
      <p>
        The abstract operation IsValidDuration returns *true* if its arguments form valid input from which to construct a Temporal.Duration, and *false* otherwise.
      </p>
      <emu-alg>
        1. Let _sign_ be ! DurationSign(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_).
        1. For each value _v_ of « _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ », do
          1. If _v_ is not finite, return *false*.
          1. If _v_ &lt; 0 and _sign_ &gt; 0, return *false*.
          1. If _v_ &gt; 0 and _sign_ &lt; 0, return *false*.
        1. Return *true*.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-defaulttemporallargestunit" aoid="DefaultTemporalLargestUnit">
      <h1>DefaultTemporalLargestUnit ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_ )</h1>
      <p>
        The abstract operation DefaultTemporalLargestUnit implements the logic used in the `Temporal.Duration.prototype.round()` method and elsewhere, where the `largestUnit` option, if not given explicitly, is set to the largest non-zero unit in the input Temporal.Duration.
      </p>
      <emu-alg>
        1. If _years_ is not zero, return *"year"*.
        1. If _months_ is not zero, return *"month"*.
        1. If _weeks_ is not zero, return *"week"*.
        1. If _days_ is not zero, return *"day"*.
        1. If _hours_ is not zero, return *"hour"*.
        1. If _minutes_ is not zero, return *"minute"*.
        1. If _seconds_ is not zero, return *"second"*.
        1. If _milliseconds_ is not zero, return *"millisecond"*.
        1. If _microseconds_ is not zero, return *"microsecond"*.
        1. Return *"nanosecond"*.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-topartialduration" aoid="ToPartialDuration">
      <h1>ToPartialDuration ( _temporalDurationLike_ )</h1>
      <emu-alg>
        1. If Type(_temporalDurationLike_) is not Object, then
          1. Throw a *TypeError* exception.
        1. Let _result_ be the new Record {
            [[Years]]: *undefined*,
            [[Months]]: *undefined*,
            [[Weeks]]: *undefined*,
            [[Days]]: *undefined*,
            [[Hours]]: *undefined*,
            [[Minutes]]: *undefined*,
            [[Seconds]]: *undefined*,
            [[Milliseconds]]: *undefined*,
            [[Microseconds]]: *undefined*,
            [[Nanoseconds]]: *undefined*
          }.
        1. Let _any_ be *false*.
        1. For each row of <emu-xref href="#table-temporal-temporaldurationlike-properties"></emu-xref>, except the header row, in table order, do
          1. Let _property_ be the Property value of the current row.
          1. Let _value_ be ? Get(_temporalDurationLike_, _property_).
          1. If _value_ is not *undefined*, then
            1. Set _any_ to *true*.
            1. Set _value_ to ? ToIntegerOrInfinity(_value_).
            1. Set _result_'s internal slot whose name is the Internal Slot value of the current row to _value_.
        1. If _any_ is *false*, then
          1. Throw a *TypeError* exception.
        1. Return _result_.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-createtemporalduration" aoid="CreateTemporalDuration">
      <h1>CreateTemporalDuration ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_ [ , _newTarget_ ] )</h1>
      <emu-alg>
        1. If ! IsValidDuration(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_) is *false*, throw a *RangeError* exception.
        1. If _newTarget_ is not present, set it to %Temporal.Duration%.
        1. Let _object_ be ? OrdinaryCreateFromConstructor(_newTarget_, *"%Temporal.Duration.prototype%"*, « [[InitializedTemporalDuration]], [[Years]], [[Months]], [[Weeks]], [[Days]], [[Hours]], [[Minutes]], [[Seconds]], [[Milliseconds]], [[Microseconds]], [[Nanoseconds]] »).
        1. Set _object_.[[Years]] to _years_.
        1. Set _object_.[[Months]] to _months_.
        1. Set _object_.[[Weeks]] to _weeks_.
        1. Set _object_.[[Days]] to _days_.
        1. Set _object_.[[Hours]] to _hours_.
        1. Set _object_.[[Minutes]] to _minutes_.
        1. Set _object_.[[Seconds]] to _seconds_.
        1. Set _object_.[[Milliseconds]] to _milliseconds_.
        1. Set _object_.[[Microseconds]] to _microseconds_.
        1. Set _object_.[[Nanoseconds]] to _nanoseconds_.
        1. Return _object_.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-calculateoffsetshift" aoid="CalculateOffsetShift">
      <h1>CalculateOffsetShift ( _relativeTo_, _y_, _mon_, _d_, _h_, _min_, _s_, _ms_, _mus_, _ns_ )</h1>
      <p>
        The abstract operation CalculateOffsetShift returns the difference in nanoseconds between the time zone offset at the time of _relativeTo_, and the time zone offset at the time of _relativeTo_ plus the given duration.
      </p>
      <emu-alg>
        1. If Type(_relativeTo_) is not Object or _relativeTo_ does not have an [[InitializedTemporalZonedDateTime]] internal slot, return 0.
        1. Let _instant_ be ! CreateTemporalInstant(_relativeTo_.[[Nanoseconds]]).
        1. Let _offsetBefore_ be ? GetOffsetNanosecondsFor(_relativeTo_.[[TimeZone]], _instant_).
        1. Let _after_ be ? AddZonedDateTime(_relativeTo_.[[Nanoseconds]], _relativeTo_.[[TimeZone]], _relativeTo_.[[Calendar]], _y_, _mon_, _d_, _h_, _min_, _s_, _ms_, _mus_, _ns_).
        1. Let _instantAfter_ be ! CreateTemporalInstant(_after_).
        1. Let _offsetAfter_ be ? GetOffsetNanosecondsFor(_relativeTo_.[[TimeZone]], _instantAfter_).
        1. Return _offsetAfter_ − _offsetBefore_.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-totaldurationnanoseconds" aoid="TotalDurationNanoseconds">
      <h1>TotalDurationNanoseconds ( _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, _offsetShift_ )</h1>
      <p>
        The abstract operation TotalDurationNanoseconds computes a mathematical value number of nanoseconds from the given units, applying a given time zone offset shift in nanoseconds when converting from days to hours.
      </p>
      <emu-alg>
        1. Assert: _offsetShift_ is an integer.
        1. Set _nanoseconds_ to ℝ(_nanoseconds_).
        1. If _days_ ≠ 0, then
          1. Set _nanoseconds_ to _nanoseconds_ − _offsetShift_.
        1. Set _hours_ to ℝ(_hours_) + ℝ(_days_) × 24.
        1. Set _minutes_ to ℝ(_minutes_) + _hours_ × 60.
        1. Set _seconds_ to ℝ(_seconds_) + _minutes_ × 60.
        1. Set _milliseconds_ to ℝ(_milliseconds_) + _seconds_ × 1000.
        1. Set _microseconds_ to ℝ(_microseconds_) + _milliseconds_ × 1000.
        1. Return _nanoseconds_ + _microseconds_ × 1000.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-balanceduration" aoid="BalanceDuration">
      <h1>BalanceDuration ( _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, _largestUnit_ [ , _relativeTo_ ] )</h1>
      <emu-alg>
        1. If _relativeTo_ is not present, set _relativeTo_ to *undefined*.
        1. If Type(_relativeTo_) is Object and _relativeTo_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
          1. Let _endNs_ be ? AddZonedDateTime(_relativeTo_.[[Nanoseconds]], _relativeTo_.[[TimeZone]], _relativeTo_.[[Calendar]], 0, 0, 0, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_).
          1. Set _nanoseconds_ to _endNs_ − _relativeTo_.[[Nanoseconds]].
        1. Else,
          1. Set _nanoseconds_ to ℤ(! TotalDurationNanoseconds(_days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, 0)).
        1. If _largestUnit_ is one of *"year"*, *"month"*, *"week"*, or *"day"*, then
          1. Let _result_ be ? NanosecondsToDays(_nanoseconds_, _relativeTo_).
          1. Set _days_ to _result_.[[Days]].
          1. Set _nanoseconds_ to _result_.[[Nanoseconds]].
        1. Else,
          1. Set _days_ to 0.
        1. Set _hours_, _minutes_, _seconds_, _milliseconds_, and _microseconds_ to 0.
        1. Set _nanoseconds_ to ℝ(_nanoseconds_).
        1. If _nanoseconds_ &lt; 0, let _sign_ be −1; else, let _sign_ be 1.
        1. Set _nanoseconds_ to abs(_nanoseconds_).
        1. If _largestUnit_ is *"year"*, *"month"*, *"week"*, *"day"*, or *"hour"*, then
          1. Set _microseconds_ to floor(_nanoseconds_ / 1000).
          1. Set _nanoseconds_ to _nanoseconds_ modulo 1000.
          1. Set _milliseconds_ to floor(_microseconds_ / 1000).
          1. Set _microseconds_ to _microseconds_ modulo 1000.
          1. Set _seconds_ to floor(_milliseconds_ / 1000).
          1. Set _milliseconds_ to _milliseconds_ modulo 1000.
          1. Set _minutes_ to floor(_seconds_ / 60).
          1. Set _seconds_ to _seconds_ modulo 60.
          1. Set _hours_ to floor(_minutes_ / 60).
          1. Set _minutes_ to _minutes_ modulo 60.
        1. Else if _largestUnit_ is *"minute"*, then
          1. Set _microseconds_ to floor(_nanoseconds_ / 1000).
          1. Set _nanoseconds_ to _nanoseconds_ modulo 1000.
          1. Set _milliseconds_ to floor(_microseconds_ / 1000).
          1. Set _microseconds_ to _microseconds_ modulo 1000.
          1. Set _seconds_ to floor(_milliseconds_ / 1000).
          1. Set _milliseconds_ to _milliseconds_ modulo 1000.
          1. Set _minutes_ to floor(_seconds_ / 60).
          1. Set _seconds_ to _seconds_ modulo 60.
        1. Else if _largestUnit_ is *"second"*, then
          1. Set _microseconds_ to floor(_nanoseconds_ / 1000).
          1. Set _nanoseconds_ to _nanoseconds_ modulo 1000.
          1. Set _milliseconds_ to floor(_microseconds_ / 1000).
          1. Set _microseconds_ to _microseconds_ modulo 1000.
          1. Set _seconds_ to floor(_milliseconds_ / 1000).
          1. Set _milliseconds_ to _milliseconds_ modulo 1000.
        1. Else if _largestUnit_ is *"millisecond"*, then
          1. Set _microseconds_ to floor(_nanoseconds_ / 1000).
          1. Set _nanoseconds_ to _nanoseconds_ modulo 1000.
          1. Set _milliseconds_ to floor(_microseconds_ / 1000).
          1. Set _microseconds_ to _microseconds_ modulo 1000.
        1. Else if _largestUnit_ is *"microsecond"*, then
          1. Set _microseconds_ to floor(_nanoseconds_ / 1000).
          1. Set _nanoseconds_ to _nanoseconds_ modulo 1000.
        1. Else,
          1. Assert: _largestUnit_ is *"nanosecond"*.
        1. Return the new Record {
          [[Days]]: 𝔽(_days_),
          [[Hours]]: 𝔽(_hours_ × _sign_),
          [[Minutes]]: 𝔽(_minutes_ × _sign_),
          [[Seconds]]: 𝔽(_seconds_ × _sign_),
          [[Milliseconds]]: 𝔽(_milliseconds_ × _sign_),
          [[Microseconds]]: 𝔽(_microseconds_ × _sign_),
          [[Nanoseconds]]: 𝔽(_nanoseconds_ × _sign_)
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-unbalancedurationrelative" aoid="UnbalanceDurationRelative">
      <h1>UnbalanceDurationRelative ( _years_, _months_, _weeks_, _days_, _largestUnit_, _relativeTo_ )</h1>
      <p>The abstract operation UnbalanceDurationRelative converts the calendar units of a Temporal.Duration into a form where no unit is larger than _largestUnit_.</p>
      <emu-alg>
        1. If _relativeTo_ is not present, set _relativeTo_ to *undefined*.
        1. If _largestUnit_ is *"year"*, or _years_, _months_, _weeks_, and _days_ are all 0, then
          1. Return the new Record {
            [[Years]]: _years_,
            [[Months]]: _months_,
            [[Weeks]]: _weeks_,
            [[Days]]: _days_
            }.
        1. Let _sign_ be ! DurationSign(_years_, _months_, _weeks_, _days_, 0, 0, 0, 0, 0, 0).
        1. Assert: _sign_ ≠ 0.
        1. Let _oneYear_ be ! CreateTemporalDuration(_sign_, 0, 0, 0, 0, 0, 0, 0, 0, 0).
        1. Let _oneMonth_ be ! CreateTemporalDuration(0, _sign_, 0, 0, 0, 0, 0, 0, 0, 0).
        1. Let _oneWeek_ be ! CreateTemporalDuration(0, 0, _sign_, 0, 0, 0, 0, 0, 0, 0).
        1. If _relativeTo_ is not *undefined*, then
          1. Set _relativeTo_ to ? ToTemporalDateTime(_relativeTo_).
          1. Let _calendar_ be _relativeTo_.[[Calendar]].
        1. Else,
          1. Let _calendar_ be *undefined*.
        1. If _largestUnit_ is *"month"*, then
          1. If _calendar_ is *undefined*, then
            1. Throw a *RangeError* exception.
          1. Let _dateAdd_ be ? GetMethod(_calendar_, *"dateAdd"*).
          1. Let _dateUntil_ be ? GetMethod(_calendar_, *"dateUntil"*).
          1. Repeat, while _years_ ≠ 0,
            1. Let _addOptions_ be ! OrdinaryObjectCreate(*null*).
            1. Let _newRelativeTo_ be ? CalendarDateAdd(_calendar_, _relativeTo_, _oneYear_, _addOptions_, _dateAdd_).
            1. Let _untilOptions_ be ! OrdinaryObjectCreate(*null*).
            1. Perform ! CreateDataPropertyOrThrow(_untilOptions_, *"largestUnit"*, *"month"*).
            1. Let _untilResult_ be ? CalendarDateUntil(_calendar_, _relativeTo_, _newRelativeTo_, _untilOptions_, _dateUntil_).
            1. Let _oneYearMonths_ be ? Get(_untilResult_, *"months"*).
            1. Set _relativeTo_ to _newRelativeTo_.
            1. Set _years_ to _years_ − _sign_.
            1. Set _months_ to _months_ + _oneYearMonths_.
        1. Else if _largestUnit_ is *"week"*, then
          1. If _calendar_ is *undefined*, then
            1. Throw a *RangeError* exception.
          1. Repeat, while _years_ ≠ 0,
            1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneYear_).
            1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
            1. Let _oneYearDays_ be _moveResult_.[[Days]].
            1. Set _years_ to _years_ − _sign_.
            1. Set _days_ to _days_ + _oneYearDays_.
          1. Repeat, while _months_ ≠ 0,
            1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
            1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
            1. Let _oneMonthDays_ be _moveResult_.[[Days]].
            1. Set _months_ to _months_ − _sign_.
            1. Set _days_ to _days_ + _oneMonthDays_.
        1. Else,
          1. If any of _years_, _months_, and _days_ are not zero, then
            1. If _calendar_ is *undefined*, then
              1. Throw a *RangeError* exception.
            1. Repeat, while _years_ ≠ 0,
              1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneYear_).
              1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
              1. Let _oneYearDays_ be _moveResult_.[[Days]].
              1. Set _years_ to _years_ − _sign_.
              1. Set _days_ to _days_ + _oneYearDays_.
            1. Repeat, while _months_ ≠ 0,
              1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
              1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
              1. Let _oneMonthDays_ be _moveResult_.[[Days]].
              1. Set _months_ to _months_ − _sign_.
              1. Set _days_ to _days_ + _oneMonthDays_.
            1. Repeat, while _weeks_ ≠ 0,
              1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneWeek_).
              1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
              1. Let _oneWeekDays_ be _moveResult_.[[Days]].
              1. Set _weeks_ to _weeks_ − _sign_.
              1. Set _days_ to _days_ + _oneWeekDays_.
        1. Return the new Record {
          [[Years]]: _years_,
          [[Months]]: _months_,
          [[Weeks]]: _weeks_,
          [[Days]]: _days_
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-balancedurationrelative" aoid="BalanceDurationRelative">
      <h1>BalanceDurationRelative ( _years_, _months_, _weeks_, _days_, _largestUnit_, _relativeTo_ )</h1>
      <p>The abstract operation BalanceDurationRelative converts the calendar units of a duration into a form where lower units are converted into higher units as much as possible, up to _largestUnit_.</p>
      <emu-alg>
        1. If _largestUnit_ is not one of *"year"*, *"month"*, or *"week"*, or _years_, _months_, _weeks_, and _days_ are all 0, then
          1. Return the new Record {
            [[Years]]: _years_,
            [[Months]]: _months_,
            [[Weeks]]: _weeks_,
            [[Days]]: _days_
            }.
        1. Let _sign_ be ! DurationSign(_years_, _months_, _weeks_, _days_, 0, 0, 0, 0, 0, 0).
        1. Assert: _sign_ ≠ 0.
        1. Let _oneYear_ be ! CreateTemporalDuration(_sign_, 0, 0, 0, 0, 0, 0, 0, 0, 0).
        1. Let _oneMonth_ be ! CreateTemporalDuration(0, _sign_, 0, 0, 0, 0, 0, 0, 0, 0).
        1. Let _oneWeek_ be ! CreateTemporalDuration(0, 0, _sign_, 0, 0, 0, 0, 0, 0, 0).
        1. Set _relativeTo_ to ? ToTemporalDateTime(_relativeTo_).
        1. Let _calendar_ be _relativeTo_.[[Calendar]].
        1. If _largestUnit_ is *"year"*, then
          1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneYear_).
          1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
          1. Let _oneYearDays_ be _moveResult_.[[Days]].
          1. Repeat, while abs(_days_) ≥ abs(_oneYearDays_),
            1. Set _days_ to _days_ − _oneYearDays_.
            1. Set _years_ to _years_ + _sign_.
            1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneYear_).
            1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
            1. Set _oneYearDays_ to _moveResult_.[[Days]].
          1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
          1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
          1. Let _oneMonthDays_ be _moveResult_.[[Days]].
          1. Repeat, while abs(_days_) ≥ abs(_oneMonthDays_),
            1. Set _days_ to _days_ − _oneMonthDays_.
            1. Set _months_ to _months_ + _sign_.
            1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
            1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
            1. Set _oneMonthDays_ to _moveResult_.[[Days]].
          1. Let _dateAdd_ be ? GetMethod(_calendar_, *"dateAdd"*).
          1. Let _addOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Let _newRelativeTo_ be ? CalendarDateAdd(_calendar_, _relativeTo_, _oneYear_, _addOptions_, _dateAdd_).
          1. Let _dateUntil_ be ? GetMethod(_calendar_, *"dateUntil"*).
          1. Let _untilOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Perform ! CreateDataPropertyOrThrow(_untilOptions_, *"largestUnit"*, *"month"*).
          1. Let _untilResult_ be ? CalendarDateUntil(_calendar_, _relativeTo_, _newRelativeTo_, _untilOptions_, _dateUntil_).
          1. Let _oneYearMonths_ be ? Get(_untilResult_, *"months"*).
          1. Repeat, while abs(_months_) ≥ abs(_oneYearMonths_),
            1. Set _months_ to _months_ − _oneYearMonths_.
            1. Set _years_ to _years_ + _sign_.
            1. Set _relativeTo_ to _newRelativeTo_.
            1. Let _addOptions_ be ! OrdinaryObjectCreate(*null*).
            1. Set _newRelativeTo_ to ? CalendarDateAdd(_calendar_, _relativeTo_, _oneYear_, _addOptions_, _dateAdd_).
            1. Let _untilOptions_ be ! OrdinaryObjectCreate(*null*).
            1. Perform ! CreateDataPropertyOrThrow(_untilOptions_, *"largestUnit"*, *"month"*).
            1. Set _untilResult_ to ? CalendarDateUntil(_calendar_, _relativeTo_, _newRelativeTo_, _untilOptions_, _dateUntil_).
            1. Set _oneYearMonths_ to ? Get(_untilResult_, *"months"*).
        1. Else if _largestUnit_ is *"month"*, then
          1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
          1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
          1. Let _oneMonthDays_ be _moveResult_.[[Days]].
          1. Repeat, while abs(_days_) ≥ abs(_oneMonthDays_),
            1. Set _days_ to _days_ − _oneMonthDays_.
            1. Set _months_ to _months_ + _sign_.
            1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
            1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
            1. Set _oneMonthDays_ to _moveResult_.[[Days]].
        1. Else,
          1. Assert: _largestUnit_ is *"week"*.
          1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneWeek_).
          1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
          1. Let _oneWeekDays_ be _moveResult_.[[Days]].
          1. Repeat, while abs(_days_) ≥ abs(_oneWeekDays_),
            1. Set _days_ to _days_ − _oneWeekDays_.
            1. Set _weeks_ to _weeks_ + _sign_.
            1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneWeek_).
            1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
            1. Set _oneWeekDays_ to _moveResult_.[[Days]].
        1. Return the new Record {
          [[Years]]: _years_,
          [[Months]]: _months_,
          [[Weeks]]: _weeks_,
          [[Days]]: _days_
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-addduration" aoid="AddDuration">
      <h1>AddDuration ( _y1_, _mon1_, _w1_, _d1_, _h1_, _min1_, _s1_, _ms1_, _mus1_, _ns1_, _y2_, _mon2_, _w2_, _d2_, _h2_, _min2_, _s2_, _ms2_, _mus2_, _ns2_, _relativeTo_ )</h1>
      <p>
        The abstract operation AddDuration adds the components of a second duration to those of a first duration, and balances the duration relative to the given date _relativeTo_ to ensure that no mixed signs remain in the result.
      </p>
      <emu-alg>
        1. Assert: _y1_, _mon1_, _w1_, _d1_, _h1_, _min1_, _s1_, _ms1_, _mus1_, _ns1_, _y2_, _mon2_, _w2_, _d2_, _h2_, _min2_, _s2_, _ms2_, _mus2_, _ns2_ are integer Number values.
        1. Let _largestUnit1_ be ! DefaultTemporalLargestUnit(_y1_, _mon1_, _w1_, _d1_, _h1_, _min1_, _s1_, _ms1_, _mus1_).
        1. Let _largestUnit2_ be ! DefaultTemporalLargestUnit(_y2_, _mon2_, _w2_, _d2_, _h2_, _min2_, _s2_, _ms2_, _mus2_).
        1. Let _largestUnit_ be ! LargerOfTwoTemporalUnits(_largestUnit1_, _largestUnit2_).
        1. If _relativeTo_ is *undefined*, then
          1. If _largestUnit_ is one of *"year"*, *"month"*, or *"week"*, then
            1. Throw a *RangeError* exception.
          1. Let _result_ be ! BalanceDuration(_d1_ + _d2_, _h1_ + _h2_, _min1_ + _min2_, _s1_ + _s2_, _ms1_ + _ms2_, _mus1_ + _mus2_, _ns1_ + _ns2_, _largestUnit_).
          1. Let _years_ be 0.
          1. Let _months_ be 0.
          1. Let _weeks_ be 0.
          1. Let _days_ be _result_.[[Days]].
          1. Let _hours_ be _result_.[[Hours]].
          1. Let _minutes_ be _result_.[[Minutes]].
          1. Let _seconds_ be _result_.[[Seconds]].
          1. Let _milliseconds_ be _result_.[[Milliseconds]].
          1. Let _microseconds_ be _result_.[[Microseconds]].
          1. Let _nanoseconds_ be _result_.[[Nanoseconds]].
        1. Else if _relativeTo_ has an [[InitializedTemporalPlainDateTime]] internal slot, then
          1. Let _calendar_ be _relativeTo_.[[Calendar]].
          1. Let _datePart_ be ? CreateTemporalDate(_relativeTo_.[[ISOYear]], _relativeTo_.[[ISOMonth]], _relativeTo_.[[ISODay]], _calendar_).
          1. Let _dateDuration1_ be ? CreateTemporalDuration(_y1_, _mon1_, _w1_, _d1_, 0, 0, 0, 0, 0, 0).
          1. Let _dateDuration2_ be ? CreateTemporalDuration(_y2_, _mon2_, _w2_, _d2_, 0, 0, 0, 0, 0, 0).
          1. Let _dateAdd_ be ? GetMethod(_calendar_, *"dateAdd"*).
          1. Let _firstAddOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Let _intermediate_ be ? CalendarDateAdd(_calendar_, _datePart_, _dateDuration1_, _firstAddOptions_, _dateAdd_).
          1. Let _secondAddOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Let _end_ be ? CalendarDateAdd(_calendar_, _intermediate_, _dateDuration2_, _secondAddOptions_, _dateAdd_).
          1. Let _dateLargestUnit_ be ! LargerOfTwoTemporalUnits(*"day"*, _largestUnit_).
          1. Let _differenceOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Perform ! CreateDataPropertyOrThrow(_differenceOptions_, *"largestUnit"*, _dateLargestUnit_).
          1. Let _dateDifference_ be ? CalendarDateUntil(_calendar_, _datePart_, _end_, _differenceOptions_).
          1. Let _result_ be ! BalanceDuration(_dateDifference_.[[Days]], _h1_ + _h2_, _min1_ + _min2_, _s1_ + _s2_, _ms1_ + _ms2_, _mus1_ + _mus2_, _ns1_ + _ns2_, _largestUnit_).
          1. Let _years_ be _dateDifference_.[[Years]].
          1. Let _months_ be _dateDifference_.[[Months]].
          1. Let _weeks_ be _dateDifference_.[[Weeks]].
          1. Let _days_ be _result_.[[Days]].
          1. Let _hours_ be _result_.[[Hours]].
          1. Let _minutes_ be _result_.[[Minutes]].
          1. Let _seconds_ be _result_.[[Seconds]].
          1. Let _milliseconds_ be _result_.[[Milliseconds]].
          1. Let _microseconds_ be _result_.[[Microseconds]].
          1. Let _nanoseconds_ be _result_.[[Nanoseconds]].
        1. Else,
          1. Assert: _relativeTo_ has an [[InitializedTemporalZonedDateTime]] internal slot.
          1. Let _timeZone_ be _relativeTo_.[[TimeZone]].
          1. Let _calendar_ be _relativeTo_.[[Calendar]].
          1. Let _intermediateNs_ be ? AddZonedDateTime(_relativeTo_.[[Nanoseconds]], _timeZone_, _calendar_, _y1_, _mon1_, _w1_, _d1_, _h1_, _min1_, _s1_, _ms1_, _mus1_, _ns1_).
          1. Let _endNs_ be ? AddZonedDateTime(_intermediateNs_, _timeZone_, _calendar_, _y2_, _mon2_, _w2_, _d2_, _h2_, _min2_, _s2_, _ms2_, _mus2_, _ns2_).
          1. If _largestUnit_ is not one of *"year"*, *"month"*, *"week"*, or *"day"*, then
            1. Let _diffNs_ be ! DifferenceInstant(_relativeTo_.[[Nanoseconds]], _endNs_, 1, *"nanosecond"*, *"halfExpand"*).
            1. Let _result_ be ! BalanceDuration(0, 0, 0, 0, 0, 0, _diffNs_, _largestUnit_).
            1. Let _years_ be 0.
            1. Let _months_ be 0.
            1. Let _weeks_ be 0.
            1. Let _days_ be 0.
            1. Let _hours_ be _result_.[[Hours]].
            1. Let _minutes_ be _result_.[[Minutes]].
            1. Let _seconds_ be _result_.[[Seconds]].
            1. Let _milliseconds_ be _result_.[[Milliseconds]].
            1. Let _microseconds_ be _result_.[[Microseconds]].
            1. Let _nanoseconds_ be _result_.[[Nanoseconds]].
          1. Else,
            1. Let _result_ be ? DifferenceZonedDateTime(_relativeTo_.[[Nanoseconds]], _endNs_, _timeZone_, _calendar_, _largestUnit_).
            1. Let _years_ be _result_.[[Years]].
            1. Let _months_ be _result_.[[Months]].
            1. Let _weeks_ be _result_.[[Weeks]].
            1. Let _days_ be _result_.[[Days]].
            1. Let _hours_ be _result_.[[Hours]].
            1. Let _minutes_ be _result_.[[Minutes]].
            1. Let _seconds_ be _result_.[[Seconds]].
            1. Let _milliseconds_ be _result_.[[Milliseconds]].
            1. Let _microseconds_ be _result_.[[Microseconds]].
            1. Let _nanoseconds_ be _result_.[[Nanoseconds]].
        1. If ! IsValidDuration(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_) is *false*, throw a *RangeError* exception.
        1. Return the new Record {
          [[Years]]: _years_,
          [[Months]]: _months_,
          [[Weeks]]: _weeks_,
          [[Days]]: _days_,
          [[Hours]]: _hours_,
          [[Minutes]]: _minutes_,
          [[Seconds]]: _seconds_,
          [[Milliseconds]]: _milliseconds_,
          [[Microseconds]]: _microseconds_,
          [[Nanoseconds]]: _nanoseconds_
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-daysuntil" aoid="DaysUntil">
      <h1>DaysUntil ( _earlier_, _later_ )</h1>
      <p>
        The abstract operation DaysUntil returns the integer number of days elapsed between the calendar dates of two Temporal object instances _earlier_ and _later_.
        If _earlier_ is later than _later_, then the result is a negative integer.
      </p>
      <emu-alg>
        1. Assert: _earlier_ and _later_ both have [[ISOYear]], [[ISOMonth]], and [[ISODay]] internal slots.
        1. Let _difference_ be ! DifferenceISODate(_earlier_.[[ISOYear]], _earlier_.[[ISOMonth]], _earlier_.[[ISODay]], _later_.[[ISOYear]], _later_.[[ISOMonth]], _later_.[[ISODay]], *"day"*).
        1. Return _difference_.[[Days]].
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-moverelativedate" aoid="MoveRelativeDate">
      <h1>MoveRelativeDate ( _calendar_, _relativeTo_, _duration_ )</h1>
      <p>
        The abstract operation MoveRelativeDate takes a Temporal.PlainDateTime object _relativeTo_, and adds a Temporal.Duration _duration_ to it, returning a record with the result as well as the number of days added according to the calendar reckoning of _calendar_.
        This is used when balancing or rounding durations relative to a particular date.
      </p>
      <emu-alg>
        1. Let _options_ be ! OrdinaryObjectCreate(*null*).
        1. Let _later_ be ? CalendarDateAdd(_calendar_, _relativeTo_, _duration_, _options_).
        1. Let _days_ be ? DaysUntil(_relativeTo_, _later_).
        1. Let _dateTime_ be ? CreateTemporalDateTime(_later_.[[ISOYear]], _later_.[[ISOMonth]], _later_.[[ISODay]], _relativeTo_.[[ISOHour]], _relativeTo_.[[ISOMinute]], _relativeTo_.[[ISOSecond]], _relativeTo_.[[ISOMillisecond]], _relativeTo_.[[ISOMicrosecond]], _relativeTo_.[[ISONanosecond]], _relativeTo_.[[Calendar]]).
        1. Return the new Record {
            [[RelativeTo]]: _dateTime_,
            [[Days]]: _days_
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-moverelativezoneddatetime" aoid="MoveRelativeZonedDateTime">
      <h1>MoveRelativeZonedDateTime ( _zonedDateTime_, _years_, _months_, _weeks_, _days_ )</h1>
      <p>
        The abstract operation MoveRelativeZonedDateTime adjusts the calendar part of a Temporal.ZonedDateTime instance for use as the "relative-to" parameter of another operation.
      </p>
      <emu-alg>
        1. Let _intermediateNs_ be ? AddZonedDateTime(_zonedDateTime_.[[Nanoseconds]], _zonedDateTime_.[[TimeZone]], _zonedDateTime_.[[Calendar]], _years_, _months_, _weeks_, _days_, 0, 0, 0, 0, 0, 0).
        1. Return ? CreateTemporalZonedDateTime(_intermediateNs_, _zonedDateTime_.[[TimeZone]], _zonedDateTime_.[[Calendar]]).
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-roundduration" aoid="RoundDuration">
      <h1>RoundDuration ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, _increment_, _unit_, _roundingMode_ [ , _relativeTo_ ] )</h1>
      <emu-alg>
        1. If _relativeTo_ is not present, set _relativeTo_ to *undefined*.
        1. Let _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, and _increment_ each be the mathematical values of themselves.
        1. If _unit_ is *"year"*, *"month"*, or *"week"*, and _relativeTo_ is *undefined*, then
          1. Throw a *RangeError* exception.
        1. Let _zonedRelativeTo_ be *undefined*.
        1. If _relativeTo_ is not *undefined*, then
          1. If _relativeTo_ has an [[InitializedTemporalZonedDateTime]] internal slot, then
            1. Let _instant_ be ! CreateTemporalInstant(_relativeTo_.[[Nanoseconds]]).
            1. Set _zonedRelativeTo_ to _relativeTo_.
            1. Set _relativeTo_ to ? BuiltinTimeZoneGetPlainDateTimeFor(_relativeTo_.[[TimeZone]], _instant_, _relativeTo_.[[Calendar]]).
          1. Else,
            1. Assert: _relativeTo_ has an [[InitializedTemporalDateTime]] internal slot.
          1. Let _calendar_ be _relativeTo_.[[Calendar]].
        1. If _unit_ is one of *"year"*, *"month"*, *"week"*, or *"day"*, then
          1. Let _nanoseconds_ be ! TotalDurationNanoseconds(0, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, 0).
          1. Let _intermediate_ be *undefined*.
          1. If _zonedRelativeTo_ is not *undefined*, then
            1. Let _intermediate_ be ? MoveRelativeZonedDateTime(_zonedRelativeTo_, _years_, _months_, _weeks_, _days_).
          1. Let _result_ be ? NanosecondsToDays(_nanoseconds_, _intermediate_).
          1. Set _days_ to _days_ + _result_.[[Days]] + _result_.[[Nanoseconds]] / _result_.[[DayLength]].
          1. Set _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, and _nanoseconds_ to 0.
        1. Else,
          1. Let _fractionalSeconds_ be _nanoseconds_ × 10<sup>−9</sup> + _microseconds_ × 10<sup>−6</sup> + _milliseconds_ × 10<sup>−3</sup> + _seconds_.
        1. Let _remainder_ be *undefined*.
        1. If _unit_ is *"year"*, then
          1. Let _yearsDuration_ be ? CreateTemporalDuration(_years_, 0, 0, 0, 0, 0, 0, 0, 0, 0).
          1. Let _dateAdd_ be ? GetMethod(_calendar_, *"dateAdd"*).
          1. Let _firstAddOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Let _yearsLater_ be ? CalendarDateAdd(_calendar_, _relativeTo_, _yearsDuration_, _firstAddOptions_, _dateAdd_).
          1. Let _yearsMonthsWeeks_ be ? CreateTemporalDuration(_years_, _months_, _weeks_, 0, 0, 0, 0, 0, 0, 0).
          1. Let _secondAddOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Let _yearsMonthsWeeksLater_ be ? CalendarDateAdd(_calendar_, _relativeTo_, _yearsMonthsWeeks_, _secondAddOptions_, _dateAdd_).
          1. Let _monthsWeeksInDays_ be ? DaysUntil(_yearsLater_, _yearsMonthsWeeksLater_).
          1. Set _relativeTo_ to _yearsLater_.
          1. Let _days_ be _days_ + _monthsWeeksInDays_.
          1. Let _daysDuration_ be ? CreateTemporalDuration(0, 0, 0, _days_, 0, 0, 0, 0, 0, 0).
          1. Let _thirdAddOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Let _daysLater_ be ? CalendarDateAdd(_calendar_, _relativeTo_, _daysDuration_, _thirdAddOptions_, _dateAdd_).
          1. Let _untilOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Perform ! CreateDataPropertyOrThrow(_untilOptions_, *"largestUnit"*, *"year"*).
          1. Let _timePassed_ be ? CalendarDateUntil(_calendar_, _relativeTo_, _daysLater_, _untilOptions_).
          1. Let _yearsPassed_ be _timePassed_.[[Years]].
          1. Set _years_ to _years_ + _yearsPassed_.
          1. Let _oldRelativeTo_ be _relativeTo_.
          1. Let _yearsDuration_ be ? CreateTemporalDuration(_yearsPassed_, 0, 0, 0, 0, 0, 0, 0, 0, 0).
          1. Let _fourthAddOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Set _relativeTo_ to ? CalendarDateAdd(_calendar_, _relativeTo_, _yearsDuration_, _fourthAddOptions_, _dateAdd_).
          1. Let _daysPassed_ be ? DaysUntil(_oldRelativeTo_, _relativeTo_).
          1. Set _days_ to _days_ - _daysPassed_.
          1. Let _sign_ be ! Sign(_days_).
          1. If _sign_ is 0, set _sign_ to 1.
          1. Let _oneYear_ be ? CreateTemporalDuration(_sign_, 0, 0, 0, 0, 0, 0, 0, 0, 0).
          1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneYear_).
          1. Let _oneYearDays_ be _moveResult_.[[Days]].
          1. Let _fractionalYears_ be _years_ + _days_ / abs(_oneYearDays_).
          1. Set _years_ to ! RoundNumberToIncrement(_fractionalYears_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalYears_ - _years_.
          1. Set _months_, _weeks_, and _days_ to 0.
        1. Else if _unit_ is *"month"*, then
          1. Let _yearsMonths_ be ? CreateTemporalDuration(_years_, _months_, 0, 0, 0, 0, 0, 0, 0, 0).
          1. Let _dateAdd_ be ? GetMethod(_calendar_, *"dateAdd"*).
          1. Let _firstAddOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Let _yearsMonthsLater_ be ? CalendarDateAdd(_calendar_, _relativeTo_, _yearsMonths_, _firstAddOptions_, _dateAdd_).
          1. Let _yearsMonthsWeeks_ be ? CreateTemporalDuration(_years_, _months_, _weeks_, 0, 0, 0, 0, 0, 0, 0).
          1. Let _secondAddOptions_ be ! OrdinaryObjectCreate(*null*).
          1. Let _yearsMonthsWeeksLater_ be ? CalendarDateAdd(_calendar_, _relativeTo_, _yearsMonthsWeeks_, _secondAddOptions_, _dateAdd_).
          1. Let _weeksInDays_ be ? DaysUntil(_yearsMonthsLater_, _yearsMonthsWeeksLater_).
          1. Set _relativeTo_ to _yearsMonthsLater_.
          1. Let _days_ be _days_ + _weeksInDays_.
          1. Let _sign_ be ! Sign(_days_).
          1. If _sign_ is 0, set _sign_ to 1.
          1. Let _oneMonth_ be ? CreateTemporalDuration(0, _sign_, 0, 0, 0, 0, 0, 0, 0, 0).
          1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
          1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
          1. Let _oneMonthDays_ be _moveResult_.[[Days]].
          1. Repeat, while abs(_days_) ≥ abs(_oneMonthDays_),
            1. Set _months_ to _months_ + _sign_.
            1. Set _days_ to _days_ − _oneMonthDays_.
            1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneMonth_).
            1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
            1. Set _oneMonthDays_ to _moveResult_.[[Days]].
          1. Let _fractionalMonths_ be _months_ + _days_ / abs(_oneMonthDays_).
          1. Set _months_ to ! RoundNumberToIncrement(_fractionalMonths_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalMonths_ - _months_.
          1. Set _weeks_ and _days_ to 0.
        1. Else if _unit_ is *"week"*, then
          1. Let _sign_ be ! Sign(_days_).
          1. If _sign_ is 0, set _sign_ to 1.
          1. Let _oneWeek_ be ? CreateTemporalDuration(0, 0, _sign_, 0, 0, 0, 0, 0, 0, 0).
          1. Let _moveResult_ be ? MoveRelativeDate(_calendar_, _relativeTo_, _oneWeek_).
          1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
          1. Let _oneWeekDays_ be _moveResult_.[[Days]].
          1. Repeat, while abs(_days_) ≥ abs(_oneWeekDays_),
            1. Set _weeks_ to _weeks_ + _sign_.
            1. Set _days_ to _days_ − _oneWeekDays_.
            1. Set _moveResult_ to ? MoveRelativeDate(_calendar_, _relativeTo_, _oneWeek_).
            1. Set _relativeTo_ to _moveResult_.[[RelativeTo]].
            1. Set _oneWeekDays_ to _moveResult_.[[Days]].
          1. Let _fractionalWeeks_ be _weeks_ + _days_ / abs(_oneWeekDays_).
          1. Set _weeks_ to ! RoundNumberToIncrement(_fractionalWeeks_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalWeeks_ - _weeks_.
          1. Set _days_ to 0.
        1. Else if _unit_ is *"day"*, then
          1. Let _fractionalDays_ be _days_.
          1. Set _days_ to ! RoundNumberToIncrement(_days_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalDays_ - _days_.
        1. Else if _unit_ is *"hour"*, then
          1. Let _fractionalHours_ be (_fractionalSeconds_ / 60 + _minutes_) / 60 + _hours_.
          1. Set _hours_ to ! RoundNumberToIncrement(_fractionalHours_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalHours_ - _hours_.
          1. Set _minutes_, _seconds_, _milliseconds_, _microseconds_, and _nanoseconds_ to 0.
        1. Else if _unit_ is *"minute"*, then
          1. Let _fractionalMinutes_ be _fractionalSeconds_ / 60 + _minutes_.
          1. Set _minutes_ to ! RoundNumberToIncrement(_fractionalMinutes_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalMinutes_ - _minutes_.
          1. Set _seconds_, _milliseconds_, _microseconds_, and _nanoseconds_ to 0.
        1. Else if _unit_ is *"second"*, then
          1. Set _seconds_ to ! RoundNumberToIncrement(_fractionalSeconds_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalSeconds_ - _seconds_.
          1. Set _milliseconds_, _microseconds_, and _nanoseconds_ to 0.
        1. Else if _unit_ is *"millisecond"*, then
          1. Let _fractionalMilliseconds_ be _nanoseconds_ × 10<sup>−6</sup> + _microseconds_ × 10<sup>−3</sup> + _milliseconds_.
          1. Set _milliseconds_ to ! RoundNumberToIncrement(_fractionalMilliseconds_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalMilliseconds_ - _milliseconds_.
          1. Set _microseconds_ and _nanoseconds_ to 0.
        1. Else if _unit_ is *"microsecond"*, then
          1. Let _fractionalMicroseconds_ be _nanoseconds_ × 10<sup>−3</sup> + _microseconds_.
          1. Set _microseconds_ to ! RoundNumberToIncrement(_fractionalMicroseconds_, _increment_, _roundingMode_).
          1. Set _remainder_ to _fractionalMicroseconds_ - _microseconds_.
          1. Set _nanoseconds_ to 0.
        1. Else,
          1. Assert: _unit_ is *"nanosecond"*.
          1. Set _remainder_ to _nanoseconds_.
          1. Set _nanoseconds_ to ! RoundNumberToIncrement(_nanoseconds_, _increment_, _roundingMode_).
          1. Set _remainder_ to _remainder_ − _nanoseconds_.
        1. Return the new Record {
          [[Years]]: _years_,
          [[Months]]: _months_,
          [[Weeks]]: _weeks_,
          [[Days]]: _days_,
          [[Hours]]: _hours_,
          [[Minutes]]: _minutes_,
          [[Seconds]]: _seconds_,
          [[Milliseconds]]: _milliseconds_,
          [[Microseconds]]: _microseconds_,
          [[Nanoseconds]]: _nanoseconds_,
          [[Remainder]]: _remainder_
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-adjustroundeddurationdays" aoid="AdjustRoundedDurationDays">
      <h1>AdjustRoundedDurationDays ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, _increment_, _unit_, _roundingMode_ [ , _relativeTo_ ] )</h1>
      <p>
        The abstract operation AdjustRoundedDurationDays adjusts, if necessary, a duration that was rounded to a unit of hours or lower relative to a Temporal.ZonedDateTime.
        On a calendar day that is not 24 hours in length due to time zone offset changes, it is possible for a duration's time units to round up to exceed the day's length.
        In this case, the days part of the duration is adjusted by one, and the time part is re-rounded.
      </p>
      <emu-alg>
        1. If _relativeTo_ is not present; or Type(_relativeTo_) is not Object; or _relativeTo_ does not have an [[InitializedTemporalZonedDateTime]] internal slot; or _unit_ is one of *"year"*, *"month"*, *"week"*, or *"day"*; or _unit_ is *"nanosecond"* and _increment_ is 1, then
          1. Return the new Record {
            [[Years]]: _years_,
            [[Months]]: _months_,
            [[Weeks]]: _weeks_,
            [[Days]]: _days_,
            [[Hours]]: _hours_,
            [[Minutes]]: _minutes_,
            [[Seconds]]: _seconds_,
            [[Milliseconds]]: _milliseconds_,
            [[Microseconds]]: _microseconds_,
            [[Nanoseconds]]: _nanoseconds_
            }.
        1. Let _timeRemainderNs_ be ? TotalDurationNanoseconds(0, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, 0).
        1. Let _direction_ be ! ℝ(Sign(𝔽(_timeRemainderNs_))).
        1. Let _dayStart_ be ? AddZonedDateTime(_relativeTo_.[[Nanoseconds]], _relativeTo_.[[TimeZone]], _relativeTo_.[[Calendar]], _years_, _months_, _weeks_, _days_, 0, 0, 0, 0, 0, 0).
        1. Let _dayEnd_ be ? AddZonedDateTime(_dayStart_, _relativeTo_.[[TimeZone]], _relativeTo_.[[Calendar]], 0, 0, 0, _direction_, 0, 0, 0, 0, 0, 0).
        1. Let _dayLengthNs_ be ℝ(_dayEnd_ − _dayStart_).
        1. If (_timeRemainderNs_ − _dayLengthNs_) × _direction_ &lt; 0, then
          1. Return the new Record {
            [[Years]]: _years_,
            [[Months]]: _months_,
            [[Weeks]]: _weeks_,
            [[Days]]: _days_,
            [[Hours]]: _hours_,
            [[Minutes]]: _minutes_,
            [[Seconds]]: _seconds_,
            [[Milliseconds]]: _milliseconds_,
            [[Microseconds]]: _microseconds_,
            [[Nanoseconds]]: _nanoseconds_
            }.
        1. Set _timeRemainderNs_ to ? RoundTemporalInstant(ℤ(_timeRemainderNs_ − _dayLengthNs_), _increment_, _unit_, _roundingMode_).
        1. Let _adjustedDateDuration_ be ? AddDuration(_years_, _months_, _weeks_, _days_, 0, 0, 0, 0, 0, 0, 0, 0, 0, _direction_, 0, 0, 0, 0, 0, 0, _relativeTo_).
        1. Let _adjustedTimeDuration_ be ? BalanceDuration(0, 0, 0, 0, 0, 0, _timeRemainderNs_, *"hour"*).
        1. Return the new Record {
          [[Years]]: _adjustedDateDuration_.[[Years]],
          [[Months]]: _adjustedDateDuration_.[[Months]],
          [[Weeks]]: _adjustedDateDuration_.[[Weeks]],
          [[Days]]: _adjustedDateDuration_.[[Days]],
          [[Hours]]: _adjustedTimeDuration_.[[Hours]],
          [[Minutes]]: _adjustedTimeDuration_.[[Minutes]],
          [[Seconds]]: _adjustedTimeDuration_.[[Seconds]],
          [[Milliseconds]]: _adjustedTimeDuration_.[[Milliseconds]],
          [[Microseconds]]: _adjustedTimeDuration_.[[Microseconds]],
          [[Nanoseconds]]: _adjustedTimeDuration_.[[Nanoseconds]]
          }.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-tolimitedtemporalduration" aoid="ToLimitedTemporalDuration">
      <h1>ToLimitedTemporalDuration ( _temporalDurationLike_, _disallowedFields_ )</h1>
      <emu-alg>
        1. If Type(_temporalDurationLike_) is not Object, then
          1. Let _str_ be ? ToString(_temporalDurationLike_).
          1. Let _duration_ be ? ParseTemporalDurationString(_str_).
        1. Else,
          1. Let _duration_ be ? ToTemporalDurationRecord(_temporalDurationLike_).
        1. If ! IsValidDuration(_duration_.[[Years]], _duration_.[[Months]], _duration_.[[Weeks]], _duration_.[[Days]], _duration_.[[Hours]], _duration_.[[Minutes]], _duration_.[[Seconds]], _duration_.[[Milliseconds]], _duration_.[[Microseconds]], _duration_.[[Nanoseconds]]) is *false*, throw a *RangeError* exception.
        1. For each row of <emu-xref href="#table-temporal-temporaldurationlike-properties"></emu-xref>, except the header row, in table order, do
          1. Let _prop_ be the Property value of the current row.
          1. Let _value_ be _duration_'s internal slot whose name is the Internal Slot value of the current row.
          1. If _value_ is not 0 and _disallowedFields_ contains _prop_, then
            1. Throw a *RangeError* exception.
        1. Return _duration_.
      </emu-alg>
    </emu-clause>

    <emu-clause id="sec-temporal-temporaldurationtostring" aoid="TemporalDurationToString">
      <h1>TemporalDurationToString ( _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_, _precision_ )</h1>
      <emu-alg>
        1. Assert: _precision_ is not *"minute"*.
        1. Set _seconds_ to the mathematical value of _seconds_.
        1. Set _milliseconds_ to the mathematical value of _milliseconds_.
        1. Set _microseconds_ to the mathematical value of _microseconds_.
        1. Set _nanoseconds_ to the mathematical value of _nanoseconds_.
        1. Let _sign_ be ! DurationSign(_years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, _nanoseconds_).
        1. Set _microseconds_ to _microseconds_ + the integral part of _nanoseconds_ / 1000.
        1. Set _nanoseconds_ to _nanoseconds_ modulo 1000.
        1. Set _milliseconds_ to _milliseconds_ + the integral part of _microseconds_ / 1000.
        1. Set _microseconds_ to _microseconds_ modulo 1000.
        1. Set _seconds_ to _seconds_ + the integral part of _milliseconds_ / 1000.
        1. Set _milliseconds_ to _milliseconds_ modulo 1000.
        1. If _years_, _months_, _weeks_, _days_, _hours_, _minutes_, _seconds_, _milliseconds_, _microseconds_, and _nanoseconds_ are all 0, then
          1. Return the string *"PT0S"*.
        1. Let _datePart_ be *""*.
        1. If _years_ is not 0, then
          1. Set _datePart_ to the string concatenation of abs(_years_) formatted as a decimal number and the code unit 0x0059 (LATIN CAPITAL LETTER Y).
        1. If _months_ is not 0, then
          1. Set _datePart_ to the string concatenation of _datePart_, abs(_months_) formatted as a decimal number, and the code unit 0x004D (LATIN CAPITAL LETTER M).
        1. If _weeks_ is not 0, then
          1. Set _datePart_ to the string concatenation of _datePart_, abs(_weeks_) formatted as a decimal number, and the code unit 0x0057 (LATIN CAPITAL LETTER W).
        1. If _days_ is not 0, then
          1. Set _datePart_ to the string concatenation of _datePart_, abs(_days_) formatted as a decimal number, and the code unit 0x0044 (LATIN CAPITAL LETTER D).
        1. Let _timePart_ be *""*.
        1. If _hours_ is not 0, then
          1. Set _timePart_ to the string concatenation of abs(_hours_) formatted as a decimal number and the code unit 0x0048 (LATIN CAPITAL LETTER H).
        1. If _minutes_ is not 0, then
          1. Set _timePart_ to the string concatenation of _timePart_, abs(_minutes_) formatted as a decimal number, and the code unit 0x004D (LATIN CAPITAL LETTER M).
        1. If any of _seconds_, _milliseconds_, _microseconds_, and _nanoseconds_ are not 0, then
          1. Let _fraction_ be abs(_milliseconds_) × 10<sup>6</sup> + abs(_microseconds_) × 10<sup>3</sup> + abs(_nanoseconds_).
          1. Let _decimalPart_ be _fraction_ formatted as a nine-digit decimal number, padded to the left with zeroes if necessary.
          1. If _precision_ is *"auto"*, then
            1. Set _decimalPart_ to the longest possible substring of _decimalPart_ starting at position 0 and not ending with the code unit 0x0030 (DIGIT ZERO).
          1. Else if _precision_ ≠ 0, then
            1. Set _decimalPart_ to the substring of _decimalPart_ from 0 to _precision_.
          1. Let _secondsPart_ be abs(_seconds_) formatted as a decimal number.
          1. If _decimalPart_ is not *""*, then
            1. Set _secondsPart_ to the string-concatenation of _secondsPart_, the code unit 0x002E (FULL STOP), and _decimalPart_.
          1. Set _timePart_ to the string concatenation of _timePart_, _secondsPart_, and the code unit 0x0053 (LATIN CAPITAL LETTER S).
        1. Let _signPart_ be the code unit 0x002D (HYPHEN-MINUS) if _sign_ &lt; 0, and otherwise the empty String.
        1. Let _result_ be the string concatenation of _signPart_, the code unit 0x0050 (LATIN CAPITAL LETTER P) and _datePart_.
        1. If _timePart_ is not *""*, then
          1. Set _result_ to the string concatenation of _result_, the code unit 0x0054 (LATIN CAPITAL LETTER T), _timePart_, and _secondsPart_.
        1. Return _result_.
      </emu-alg>
    </emu-clause>

    <emu-table id="table-temporal-temporaldurationlike-properties">
      <emu-caption>Properties of a TemporalDurationLike</emu-caption>
      <table class="real-table">
        <thead>
          <tr>
            <th>Internal Slot</th>
            <th>Property</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>[[Days]]</td>
            <td>*"days"*</td>
          </tr>
          <tr>
            <td>[[Hours]]</td>
            <td>*"hours"*</td>
          </tr>
          <tr>
            <td>[[Microseconds]]</td>
            <td>*"microseconds"*</td>
          </tr>
          <tr>
            <td>[[Milliseconds]]</td>
            <td>*"milliseconds"*</td>
          </tr>
          <tr>
            <td>[[Minutes]]</td>
            <td>*"minutes"*</td>
          </tr>
          <tr>
            <td>[[Months]]</td>
            <td>*"months"*</td>
          </tr>
          <tr>
            <td>[[Nanoseconds]]</td>
            <td>*"nanoseconds"*</td>
          </tr>
          <tr>
            <td>[[Seconds]]</td>
            <td>*"seconds"*</td>
          </tr>
          <tr>
            <td>[[Weeks]]</td>
            <td>*"weeks"*</td>
          </tr>
          <tr>
            <td>[[Years]]</td>
            <td>*"years"*</td>
          </tr>
        </tbody>
      </table>
    </emu-table>
  </emu-clause>
</emu-clause>
